home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / bin / gnroff < prev    next >
Text File  |  1995-07-17  |  789b  |  57 lines

  1. #!/bin/sh
  2. # Emulate nroff with groff.
  3.  
  4. prog="$0"
  5. # Default device.
  6. T=-Tascii
  7. opts=
  8.  
  9. for i
  10. do
  11.     case $1 in
  12.     -h)
  13.         opts="$opts -P-h"
  14.         ;;
  15.     -[eq]|-s*)
  16.         # ignore these options
  17.         ;;
  18.     -[mrnoT])
  19.         echo "$prog: option $1 requires an argument" >&2
  20.         exit 1
  21.         ;;
  22.     -i|-[mrno]*)
  23.         opts="$opts $1";
  24.         ;;
  25.  
  26.     -Tascii|-Tlatin1)
  27.         T=$1
  28.         ;;
  29.     -T*)
  30.         # ignore other devices
  31.         ;;
  32.     -u*)
  33.         # Solaris 2.2 `man' uses -u0; ignore it,
  34.         # since `less' and `more' can use the emboldening info.
  35.         ;;
  36.     --)
  37.         shift
  38.         break
  39.         ;;
  40.     -)
  41.         break
  42.         ;;
  43.     -*)
  44.         echo "$prog: invalid option $1" >&2
  45.         exit 1
  46.         ;;
  47.     *)
  48.         break
  49.         ;;
  50.     esac
  51.     shift
  52. done
  53.  
  54. # This shell script is intended for use with man, so warnings are
  55. # probably not wanted.  Also load nroff-style character definitions.
  56. exec groff -Wall -mtty-char $T $opts ${1+"$@"}
  57.